package com.example.mapper;

import com.example.entity.Buyer;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BuyerMapper {
    List<Buyer> selectAll();

    @Select("select * from `buyer` where id = #{id}")
    Buyer selectById(Integer id);

    void insert(Buyer buyer);

    List<Buyer> selectAll(Buyer buyer);

    @Select("select * from `buyer` where username = #{username}")
    Buyer selectByUsername(String username);

    @Select("SELECT username FROM `buyer` WHERE id = #{id}")
    String selectUsernameById(Integer id);


}
